package com.farmneighbor.javaevent;

import lombok.*;

import java.util.Objects;

public class Hero {
    private String name;
    private int strength;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getStrength() {
        return strength;
    }

    public void setStrength(int strength) {
        this.strength = strength;
    }

    public Hero(String name, int strength) {
        this.name = name;
        this.strength = strength;
    }

    @Override
    public boolean equals(Object o) {
        if (!(o instanceof Hero hero)) return false;
        return strength == hero.strength && Objects.equals(name, hero.name);
    }




    @Override
    public int hashCode() {
        return Objects.hash(name, strength);
    }

    @Override
    public String toString() {
        return "Hero{" +
                "name='" + name + '\'' +
                ", strength=" + strength +
                '}';
    }
}